/*
 * Copyright (c) 2022 CompanyNameMagicTag.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef GRAPHIC_HARDWARE_CONFIG_H
#define GRAPHIC_HARDWARE_CONFIG_H

/**
 * @brief Hardware acceleration for drawing path. Prerequirement is ENABLE_VGU_ENGINE is 1.
 */
#define CAPABILITY_HWDRAW_PATH                   1
/**
 * @brief Hardware acceleration for drawing letter vector path. Prerequirement is that BOARD_CS defined
 *  and both ENABLE_VGU_ENGINE and CAPABILITY_HWDRAW_PATH is 1.
 */
#define CAPABILITY_HWDRAW_LETTER_VECTOR          1
/**
 * @brief Hardware acceleration for drawing alpha bitmap. Prerequirement is ENABLE_VGU_ENGINE is 1.
 */
#define CAPABILITY_HWDRAW_ALPHA_BITMAP           1
/**
 * @brief 1 means outRect is supported.
 *        0 means outRect is not supported, and must be same as the buffer rect.
 */
#define CAPABILITY_HW_OUT_RECT                   1
/**
 * @brief Hardware acceleration for rotate and scale in one operation.
 */
#define CAPABILITY_HW_ROTATE_AND_SCALE           1
/**
 * @brief Enable JPEG preview which includes decoding jpeg file and cacheing decoded data.
 */
#define CAPABILITY_HW_JPEG_DECODE                1
/**
 * @brief Hardware acceleration for gaussian blur.
 */
#define CAPABILITY_HW_GAUSSIAN_BLUR              1
/**
 * @brief ENABLE GMMU MEM. Prerequimrent is BOARD_CS defined.
 */
#define ENABLE_GMMU                              0
/**
 * @brief specify buffer mode when use single buffer.
 *        1 means compressed buffer.
 *        0 means uncompressed buffer.
 */
#define BUFFER_COMPRESS                          0
/**
 * @brief Some of hardware acceleration operations requires an aligned rect.
 *        If this prerequisite is not meet, it could cause extra data been handled.
 */
#define HW_RECT_ALIGN_RESTRICTION                0
/**
 * @brief Default path for compressed img bin file.
 *        VER1 means that img bin file is for CS version.
 *        VER0 means that img bin file is for ES version.
 */
#define CMP_RES_PATH                             "/bin/vs/sd0p0/pic/VER1_"
/**
 * @brief Support ultra low power
 */
#define ENABLE_ULPS                              0
/**
 * @brief Hardware acceleration for drawing ellipse. Prerequirement is ENABLE_VGU_ENGINE is 1.
 */
#define CAPABILITY_HWDRAW_ELLIPSE         0
/**
 * @brief Hardware acceleration for drawing line. Prerequirement is ENABLE_VGU_ENGINE is 1.
 */
#define CAPABILITY_HWDRAW_LINE            0
/**
 * @brief Hardware acceleration for drawing arc. Prerequirement is ENABLE_VGU_ENGINE is 1.
 */
#define CAPABILITY_HWDRAW_ARC             0
/**
 * @brief Hardware acceleration for drawing cubic bezier curve. Prerequirement is ENABLE_VGU_ENGINE is 1.
 */
#define CAPABILITY_HWDRAW_CURVE           0

// if ENABLE_OPENVG is set to be 1, dislpay_vau.c should be compiled.
#define ENABLE_OPENVG 0
#if ENABLE_OPENVG
#define BLIT_COUNT_MAX 1
#else
#define BLIT_COUNT_MAX 20
#endif

#define ALIGN_UP(x, a) ((((x) + ((a) - 1)) / (a)) * (a))
#define HARDWARE_ACC_SIZE_LIMIT (50 * 50)
/**
 * @brief Use double buffer for rendering process.
 */
#define DOUBLE_BUFFER                     0
#define MEM_POOL_UI_FONT PSRAM_GUI_MEM_POOL_ADDR
#define MEM_POOL_UI_FONT_SIZE 0x380000
#define MEM_POOL_UI_OTHER (PSRAM_GUI_MEM_POOL_ADDR + MEM_POOL_UI_FONT_SIZE)
#define MEM_POOL_UI_OTHER_SIZE (PSRAM_GUI_MEM_POOL_SIZE - MEM_POOL_UI_FONT_SIZE)
#define LAYER_BPP                         24
#define RESOLUTION_WIDTH                  454
#define RESOLUTION_HEIGHT                 454
#endif // GRAPHIC_HARDWARE_CONFIG_H

#define DRAW_MAX_CNT                      48
#define STROKE_MAX_CNT                    48